#ifndef RINDEX
#define RINDEX
#include <iostream>
#include <fstream>
#include <flann/flann.hpp>

using namespace std;
using namespace flann;
typedef struct {
    double x, y, z;
} coord;

//Create an R tree index
Index < L2 < float >>*createIndex();

//Add a point to the R tree
void addPoint(Index < L2 < float > >*idx, double x, double y, double z);

//Search a point in the R tree
void getNearest_point(Index < L2 < float > >*idx, double x, double y,
                      double z, int maxResults,
                      vector < vector < int >>&indices);
void getNearest_point_radius(Index < L2 < float > >*idx, double x,
                             double y, double z, double tolerance,
                             vector < vector < int >>&indices);
#endif                            /* ifndef RINDEX */
